import request from '@/utils/request'

// 查询列表tree
export function findTree(query) {
    return request({
        url: '/ssh/manage/findTree',
        method: 'get',
        params: query
    })
}
// treeAdd
export function treeAdd(query) {
    return request({
        url: '/ssh/manage/add',
        method: 'post',
        data: query
    })
}

// addFolder
export function addFolder(query) {
    return request({
        url: '/ssh/manage/addFolder',
        method: 'post',
        data: query
    })
}

export function deleteById(query) {
    return request({
        url: '/ssh/manage/delete',
        method: 'post',
        data: query
    })
}

export function update(query) {
    return request({
        url: '/ssh/manage/update',
        method: 'post',
        data: query
    })
}

export function updateFolder(query) {
    return request({
        url: '/ssh/manage/updateFolder',
        method: 'post',
        data: query
    })
}

export function testConn(query) {
    return request({
        url: '/ssh/manage/testConn',
        method: 'post',
        data: query
    })
}

/*------------- 上传下载模块相关开始********************************/
// 移动路径
export function sftpCd(data) {
    return request({
        url: '/sftp/cd',
        method: 'post',
        data
    })
}

// 获取当前信息
export function sftpCurrentInfo(data) {
    return request({
        url: '/sftp/currentInfo',
        method: 'post',
        data
    })
}

// 删除
export function sftpDel(data) {
    return request({
        url: '/sftp/del',
        method: 'post',
        data
    })
}

// 下载
export function sftpDownload(data) {
    return request({
        url: '/sftp/download',
        method: 'post',
        data
    })
}

// 上传
export function sftpUpload(data) {
    return request({
        url: '/sftp/upload',
        method: 'post',
        data
    })
}

// 创建文件夹
export function sftpMkdir(data) {
    return request({
        url: '/sftp/mkdir',
        method: 'post',
        data
    })
}

// 重命名
export function sftpRename(data) {
    return request({
        url: '/sftp/rename',
        method: 'post',
        data
    })
}



/*------------- 上传下载模块相关结束********************************/